package com.jielihaofeng.shop.security.config;

import com.jielihaofeng.shop.security.config.bean.LoginProperties;
import com.jielihaofeng.shop.security.config.bean.SecurityProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description 将配置注册到容器
 * @author Johnnie Wind
 * @date 2021/2/27 10:05
 */
@Configuration
public class ConfigBeanConfiguration {

    /**
     * @description 登录配置
     * @author Johnnie Wind
     * @date 2021/2/27 10:07
     * @Param []
     * @return com.jielihaofeng.shop.security.config.bean.LoginProperties
     */
    @Bean
    @ConfigurationProperties(prefix = "login",ignoreUnknownFields = true)
    public LoginProperties loginProperties(){
        return new LoginProperties();
    }

    /**
     * @description jwt配置
     * @author Johnnie Wind
     * @date 2021/2/27 10:07
     * @Param []
     * @return com.jielihaofeng.shop.security.config.bean.SecurityProperties
     */
    @Bean
    @ConfigurationProperties(prefix = "jwt",ignoreUnknownFields = true)
    public SecurityProperties securityProperties(){
        return new SecurityProperties();
    }
}
